home *** CD-ROM | disk | FTP | other *** search
- // include javascript classes
- include("oops/r3button.js");
- include("oops/r3window.js");
- include("oops/r3packer.js");
-
- // callback for the buttons
- function myhook(window, event, value)
- {
- R3Exit(); // exit app.
- return 1;
- }
-
- // create a window
- window = new r3Window(R3WGA_Parent, _r3gui,
- R3WGA_Left, 200,
- R3WGA_Top, 100,
- R3WA_Title, "Packer Hierarchy",
- R3WA_ReportCloseWindow, TRUE,
- R3WA_ReportNewSize, TRUE);
-
- // create the top level packer and attach it to the window
- packer = new r3Packer(R3PA_Orientation, R3PAOF_VERTICAL);
- window.SetGmanager(packer);
-
- // create two sub packers
- row1 = new r3Packer(R3PA_Orientation, R3PAOF_HORIZONTAL);
- packer.ADD(R3PAPF_FILLX, 0, row1);
- row2 = new r3Packer(R3PA_Orientation, R3PAOF_HORIZONTAL);
- packer.ADD(R3PAPF_FILLX, 0, row2);
-
-
- // create bunch of buttons and insert them into the row1
- for(i = 0; i < 5; i++) {
- button = new r3Button(R3RA_Hook, myhook, // specify hook function
- R3WGA_Parent, window,
- R3GA_Text, "Exit " + i);
- row1.ADD(R3PAPF_EXPAND | R3PAPF_FILLX | R3PAPF_FILLY, 0, button);
- }
-
- // create bunch of buttons and insert them into the row1
- for(i = 0; i < 5; i++) {
- button = new r3Button(R3WGA_Parent, window,
- R3GA_Text, "2nd row " + i);
- row2.ADD(R3PAPF_EXPAND | R3PAPF_FILLX | R3PAPF_FILLY, 0, button);
- }
-
-
- // calculate best layout for the window and make it all visible
- window.FIT(R3WFP_BESTFIT);
- window.REALIZE();
-